#ifndef _GAME_H_
#define _GAME_H_

#include "render.h"
#include <list>
#include <map>

using namespace std;

enum mouse_events
{
	mouse_move,
	mouse_l_keydown,
	mouse_r_keydown,
	mouse_l_click,
	mouse_r_
};

class widget;

class game
{
public:
	game();
	virtual ~game();

	virtual void create(xml_node& _node){}
	virtual void destroy(){}
	virtual void update(u32 _dt);
	virtual void draw();
	virtual void lost_device(){}

	virtual void event_keyboard(u32 _type,u32 _keys);
	virtual void event_mouse(u32 _type,u32 _x,u32 _y,u32 _keys);

	void add_widget(widget* _wid,const char* _name);
	void set_widget(const char* _name);

private:
	render* m_render;
	map<const char*,widget*> m_widgets;
	list<widget*> m_renderlist;
	list<widget*> m_updatelist;
};

#endif